using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._General
{
    /// <summary>
    /// <para>Delete Identical</para>
    /// <para>Deletes records in a feature class or table which have identical values in a list of fields. If the geometry field is selected, feature geometries are compared.</para>
    /// <para>删除要素类或表中字段列表中具有相同值的记录。如果选择了几何字段，则将比较要素几何。</para>
    /// </summary>    
    [DisplayName("Delete Identical")]
    public class DeleteIdentical : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public DeleteIdentical()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_dataset">
        /// <para>Input Dataset</para>
        /// <para>The table or feature class that will have its identical records deleted.</para>
        /// <para>将删除其相同记录的表或要素类。</para>
        /// </param>
        /// <param name="_fields">
        /// <para>Field(s)</para>
        /// <para>The field or fields whose values will be compared to find identical records.</para>
        /// <para>将比较其值以查找相同记录的一个或多个字段。</para>
        /// </param>
        public DeleteIdentical(object _in_dataset, List<object> _fields)
        {
            this._in_dataset = _in_dataset;
            this._fields = _fields;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Delete Identical";

        public override string CallName => "management.DeleteIdentical";

        public override List<string> AcceptEnvironments => ["XYTolerance", "ZTolerance", "extent", "maintainSpatialIndex", "workspace"];

        public override object[] ParameterInfo => [_in_dataset, _fields, _xy_tolerance, _z_tolerance, _out_dataset];

        /// <summary>
        /// <para>Input Dataset</para>
        /// <para>The table or feature class that will have its identical records deleted.</para>
        /// <para>将删除其相同记录的表或要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_dataset { get; set; }


        /// <summary>
        /// <para>Field(s)</para>
        /// <para>The field or fields whose values will be compared to find identical records.</para>
        /// <para>将比较其值以查找相同记录的一个或多个字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field(s)")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _fields { get; set; }


        /// <summary>
        /// <para>XY Tolerance</para>
        /// <para>The xy tolerance that will be applied to each vertex when evaluating if there is an identical vertex in another feature.</para>
        /// <para>在评估另一个特征中是否存在相同的折点时将应用于每个折点的 xy 容差。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("XY Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _xy_tolerance { get; set; } = null;


        /// <summary>
        /// <para>Z Tolerance</para>
        /// <para>The z tolerance that will be applied to each vertex when evaluating if there is an identical vertex in another feature.</para>
        /// <para>在评估另一个要素中是否存在相同的折点时将应用于每个折点的 z 容差。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Z Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _z_tolerance { get; set; } = 0;


        /// <summary>
        /// <para>Updated Input Dataset</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_dataset { get; set; }


        public DeleteIdentical SetEnv(object XYTolerance = null, object ZTolerance = null, object extent = null, bool? maintainSpatialIndex = null, object workspace = null)
        {
            base.SetEnv(XYTolerance: XYTolerance, ZTolerance: ZTolerance, extent: extent, maintainSpatialIndex: maintainSpatialIndex, workspace: workspace);
            return this;
        }

    }

}